"""
编写一个未指定个数的字符串，找出出现次数最多的字符串并打印其出现次数。
"""
word_counts = {}
# 输入未指定个数的字符串（这里为了示例仍然使用5次循环，但你可以根据需要调整）
for i in range(5):
    word = input()  # 直接输入字符串，不需要将其放入列表
    if word in word_counts:
        word_counts[word] += 1
    else:
        word_counts[word] = 1

# 找出出现次数最多的字符串及其次数
max_count = 0
most_common_word = ""
for word, count in word_counts.items():
    if count > max_count:
        max_count = count
        most_common_word = word

# 打印出现次数最多的字符串及其次数
print(f"The most common word is '{most_common_word}' with {max_count} occurrences.")
